home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / Sources / src / keybind / msg2c.awk < prev    next >
Encoding:
AWK Script  |  1996-09-27  |  687 b   |  24 lines

  1. BEGIN {
  2. #   Sorry, but most awk's are not able to deal with double quotes...
  3.   doublequote=sprintf("%c",34);
  4.   handle=1
  5.   FS="@"
  6.   #{{{}}}
  7. #  {{{  print auto-gen-mark
  8.   print("/* This file is generated automatically by awk -f msg2c.awk */\n/* containing the message name strings for OCL messages */")
  9. #  }}}
  10.   print("char const * const msg_list[]={")
  11.   print("   "doublequote"(not-used)"doublequote",")
  12. }
  13. /^RC-COMPRESSION-DATA *$/ { handle=0 }
  14. handle==0 { next }
  15. $1 !~ /^((#)|((STR)|(MSG)_.*))/ {
  16.    name=$1
  17.    while ((name!="") && (substr(name,length(name),1)==" "))
  18.       name=substr(name,1,length(name)-1)
  19.    print("   "doublequote name doublequote",")
  20. }
  21. END {
  22.   printf("   0};\n")
  23. }
  24.